package mlz.e_objectstream;

import java.io.Serializable;

public class Student implements Serializable {
    //添加版本唯一标识: 序列化编号
    private static final long serialVersionUID = 1L;

    //当前成员变量不进行序列化
    private transient int id;
    private String name;
    private int age;
    private char sex;


    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
